/* 
 * File:   playertest.cpp
 * Author: dolphinigle
 *
 * Created on March 12, 2011, 8:01 PM
 */

#include <stdlib.h>
#include "gtest/gtest.h"
#include "player.hpp"
#include "game.hpp"
#include "playerconstants.hpp"

void advanceDay();
  void advanceTime();
  void isInHouse();
  void resetPosition();
  bool isSteppable();

TEST(PlayerTest, All) {

  Game* game = new Game("Irvan", "test.gag");
  Player* p = new Player(game);

  Cell* init_cell = game->getMaps()->getField()->getCellAt(
          PlayerConstants::playerStartLocationXCoordinate(),
          PlayerConstants::playerStartLocationYCoordinate());

  EXPECT_FALSE(p->isSteppable());
  EXPECT_EQ(init_cell, p->getCell());
  EXPECT_FALSE(p->isInHouse());
  p->advanceTime();

  p->setLocation(game->getMaps()->getHouse()->getCellAt(1,1));
  EXPECT_FALSE(p->isSteppable());
  EXPECT_NE(init_cell, p->getCell());
  EXPECT_TRUE(p->isInHouse());

  p->advanceDay();
  EXPECT_FALSE(p->isSteppable());
  EXPECT_EQ(init_cell, p->getCell());
  EXPECT_FALSE(p->isInHouse());

  delete p;
  delete game;

}

